Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HCS schema v2 files (
internal/hcs/schema2
) haven't been updated in a while, are missing several types, do not define enum values (eg, ModifyResourceType values are manually defined ininternal\protocol\guestresource
), and default toint32
for all integer-valued fields (eg, hcsschema.ConsoleSize should haveuint16
fields)).This PR is split into 2 PRs:
swagger-codegen-cli
) on HCS schema version 2.5 (based on Windows Server 2022 (OS build 20348)) files to regenerate the hcsschema package (internal/hcs/schema2
). Additionally, add helper functions and manual updates to the package.Additionally, this PR adds a manifest of the files changed (and added) to the schema package (in
doc.go
), so manual updates can be re-applied if the schema files are re-created in the future.Note: The files show the API version as 2.4, that is controlled by the OpenAPI schema generator, which we have no control over.
Additionally, even though schema version 2.5 fields are added, since the API is versioned, no new behavior is introduced when making requests.
The major changes within
internal/hcs/schema2
are:Processor2
is now VirtualMachineProcessor).hcsschema.ConsoleSize
is now auint16
instead ofint32
). This doesn't apply to integer arrays because of limitations in swagger codegen).internal/hcs/schema2/doc.go
to describe package design considerations, add helper functions, and list files that have been manually updated.*_lookup.go
files to augment certain enum types with conversion functions. This is specifically for integer-valued enums, which OpenAPI strips information from in the spec, as well as common enums (ie,OSType
andSystemType
) which we convert from strings.*_extra.go
) files for creating certain request messages.internal/hcs/schema2/configuration.go
, which is never used).interface{}
to*json.RawMessage
globally within package to simplify (un)marshalling, and reduce the number of manual updates needed, since certain instances ofinterface{}
will need it.The generated schema files (re)define types and values manually created in
internal\protocol\guestrequest
andinternal\protocol\guestresource
, but the latter are left for a future PR to consolidate/remove.